package likou;

import java.util.Arrays;

/**
 * @author: 唐小尊
 * @email: 1171702529@qq.com
 * @cate: 2021/06/10 10:26
 */
public class _518 {
    public static void main(String[] args) {
        System.out.println(change(5,new int[]{1,2,5}));
    }
    public static int change(int amount, int[] coins) {
        int[] dp = new int[amount + 1];
        dp[0] = 1;
        for (int coin : coins) {
            for (int i = coin; i <= amount; i++) {
                dp[i] += dp[i - coin];
            }
            System.out.println(Arrays.toString(dp));
        }
        return dp[amount];
    }
}